﻿using System;

namespace Ycjw.PipeLine.Commons.Plugsin
{
    /// <summary>
    /// 插件接口
    /// </summary>
    public interface IPlugsin
    {
        /// <summary>
        /// 初始化
        /// </summary>
        void Init();

        /// <summary>
        /// 设置界面信息
        /// </summary>
        /// <param name="msg"></param>
        void SetLineTip(string msg);
    }

    /// <summary>
    /// 插件加载类型
    /// </summary>
    public enum PlugsinType
    {
        /// <summary>
        /// 在顶部加载
        /// </summary>
        Top = 0,

        /// <summary>
        /// 在右侧加载
        /// </summary>
        Right = 1,

        /// <summary>
        /// 菜单加载
        /// </summary>
        Menu = 2,

        /// <summary>
        /// 不使用
        /// </summary>
        None = 255
    }

    /// <summary>
    /// 插件特性
    /// </summary>
    public class PlugsinAttribute : Attribute
    {
        private string _Name;

        /// <summary>
        /// 名称
        /// </summary>
        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }

        private string _ModuleID;

        /// <summary>
        /// 字符串参数
        /// </summary>
        public string ModuleID
        {
            get { return _ModuleID; }
            set { _ModuleID = value; }
        }

        private PlugsinType _plugsinType;

        /// <summary>
        /// 加载类型
        /// </summary>
        public PlugsinType PlugsinType
        {
            get { return _plugsinType; }
            set { _plugsinType = value; }
        }

        private string _caption;

        /// <summary>
        /// 标题
        /// </summary>
        public string Caption
        {
            get { return _caption; }
            set { _caption = value; }
        }

        private int _Sort;

        /// <summary>
        /// 排序 ,在多个特性中的排序
        /// </summary>
        public int Sort
        {
            get { return _Sort; }
            set { _Sort = value; }
        }
    }
}